<p class="kategoria" >GRAFIK</p>
<?php
    $monday_this_week = date('Y-m-d', strtotime(date('Y') . 'W' . date('W') . 1));
    $sunday_this_week = date('Y-m-d', strtotime(date('Y') . 'W' . date('W') . 7));
    echo "<div style='padding-left: 20px;'>".$monday_this_week.' - '.$sunday_this_week . "</div>";
?>
<div id="view-content">
    <table class="grafik">

        <?php
        echo "<tr class='dni'>";
        for ($x = 1; $x < 9; $x++) {

            if ($x == 1)
                echo "<td style='border: none; background: none;'></td>"; else
            if ($x == 2)
                echo "<td style='border: none; background: none;'>Poniedziałek</td>"; else
            if ($x == 3)
                echo "<td style='border: none; background: none;'>Wtorek</td>"; else
            if ($x == 4)
                echo "<td style='border: none; background: none;'>Środa</td>"; else
            if ($x == 5)
                echo "<td style='border: none; background: none;'>Czwartek</td>"; else
            if ($x == 6)
                echo "<td style='border: none; background: none;'>Piątek</td>"; else
            if ($x == 7)
                echo "<td style='border: none; background: none;'>Sobota</td>"; else
            if ($x == 8)
                echo "<td style='border: none; background: none;'>Niedziela</td>";
        } echo "</tr>";

        for ($i = 1; $i < 8; $i++) {
            echo "<tr>";

            if ($i == 1)
                echo "<td class='godzina'>8:00-9:30</td>"; else
            if ($i == 2)
                echo "<td class='godzina'>10:00-11:30</td>"; else
            if ($i == 3)
                echo "<td class='godzina'>12:00-13:30</td>"; else
            if ($i == 4)
                echo "<td class='godzina'>14:00-15:30</td>"; else
            if ($i == 5)
                echo "<td class='godzina'>16:00-17:30</td>"; else
            if ($i == 6)
                echo "<td class='godzina'>18:00-19:30</td>"; else
            if ($i == 7)
                echo "<td class='godzina'>20:00-21:30</td>";

            for ($j = 1; $j < 8; $j++) {
                // Zend_Debug::dump($this->zajecia);
                echo "<td>";
                foreach ($this->zajecia as $zajecia) {
                    if ($zajecia['ZAJ_dzien_tygodnia'] == $j && $zajecia['ZAJ_godzina'] == $i) {
                        echo $zajecia['ZAJ_nazwa'];
                        echo "<br/>";
                    }
                }
                echo "</td>";
            }
            echo "</tr>";
        }
        ?>        

    </table>	
</div>